<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <link rel="stylesheet" href="${staticServer}/inc/style/main.css"/>
    <link rel="stylesheet" href="${staticServer}/inc/style/page.css"/>
    <link rel="stylesheet" href="${staticServer}/css/work_today.css"/>
    <link rel="stylesheet" href="${staticServer}/css/consultant_client_tracking.css"/>
    <link rel="stylesheet" href="${staticServer}/css/lanrenzhijia.css" />
    <link rel="stylesheet" href="${staticServer}/inc/style/date/datepicker.css"/>
    <script src="${staticServer}/inc/js/jquery.js"></script>
    <script src="${staticServer}/inc/js/pageset.js"></script>
    <script src="${staticServer}/inc/js/submitter.js"></script>
    <script src="${staticServer}/inc/js/tips.js"></script>
    <script src="${staticServer}/js/web/consultant_client_tracking_list.js?1.0"></script>

    <script src="${staticServer}/inc/js/infopad.js?2.2"></script>
	<script src="${staticServer}/inc/js/datepicker.js"></script>
    <script src="${staticServer}/inc/js/datepicker.js"></script>
    <script>
        var contextPath = '${contextPath}';

        $(function () {
            $("#good_type").val(${good_muns_id});
            $("#audit_status").val(${auditStatus});
            
            $("#center").val("<#if center??>${center}</#if>");
        });

        function submit() {
            var auditStatus = $("#audit_status option:selected").val();
            var center = $("#center").val();
            var itemName = $("#itemName").val();
            var startTime = $("#startTime").val();
            var endTime = $("#endTime").val();
            window.location.href = "${contextPath}/goods/myGoodsList.htm?auditStatus=" + auditStatus
            		+"&center="+center+"&itemName="+itemName+"&startTime="+startTime+"&endTime="+endTime;
        }

    function seeAppraisalGoods(id){
    	$("#appraisalId").val(id);
    	$.post("${contextPath}/goods/toSeePurchaseGoods.json",
    			{"id":id}, 
   			function(ms) {
   				var goods=ms.goods;
   				$("#purchasePerson1").val(goods.purchasePerson);
   				$("#purchaseGoods1").val(goods.purchaseGoods);
   				$("#purchaseMessage1").val(goods.purchaseMessage);
   				
   				$('.theme-popover-mask').fadeIn(100);
   	           	$('.theme-popover').slideDown(200);
   	            $('.theme-poptit .close').click(function(){
   	            $('.theme-popover-mask').fadeOut(100);
   	                $('.theme-popover').slideUp(200);
   	            })
       	});
    }
    
    function download() {
        var center = $("#center").val();
        var itemName = $("#itemName").val();
        var audit_status = $("#audit_status").val();
        var startTime = $("#startTime").val();
        var endTime = $("#endTime").val();
        if (startTime == "") {
            infopad.err("开始时间不能为空");
            return;
        }else{
        	infopad.err("正在下载，请稍等!");
        }
        $.post('${contextPath}/goods/toDownloadGoodsInfomationList.json', {
            center: center,
            itemName: itemName,
            audit_status: audit_status,
            startTime: startTime,
            endTime: endTime
        }, function (data) {
            if (data) {
                if (data.name != null) {
                    window.location.href = "http://120.55.241.58//mydata/uploadtea/xls/" + data.name;
                    //window.location.href = "G:/xuyafei/mydata/uploadoa/" + data.name;
                }
            }
        });
    }
    </script>

</head>

<body>
<input type="hidden" id="traId" value="">
<div id="home_link">
    <ul>
        <li></li>
        <li>&gt;</li>
        <li>采购管理</li>
        <li>&gt;</li>
        <li class="current">物品申请</li>
    </ul>
</div>
<div id="container">
    <div id="title">物品申请</div>
    <table class="simple_table" rel="nohover" style="min-width: 750px;">
        <tr>
            <td>
           		<label for="phone">中心地址：</label>
                <select id="center">
                    <option value="">全部</option>
                	<#if offList??>
                    <#list offList as list>
                        <option value="${list.name}">${list.name}</option>
                    </#list>
                	</#if>
                </select>
                <label>物品名称：</label>
                <input id="itemName" value="<#if itemName??>${itemName}</#if>" type="text" placeholder="物品名称" size="20"  maxlength="20"/>
                <label>审核状态：</label>
                <select id="audit_status">
                    <option value="">全部</option>
                    <option value="1">未审核</option>
                    <option value="2">审核通过</option>
                </select>
                
                <label for="phone">开始时间：</label>
                <input type="text" id="startTime" rel="DATE::Y-m-d" value="${startTime}" size="15" maxlength="15"
                       readonly="readonly" class="DatePicker_Icon">
                <label for="phone">结束时间：</label>
                <input type="text" id="endTime" rel="DATE::Y-m-d" value="${endTime}" size="15" maxlength="15"
	                       readonly="readonly" class="DatePicker_Icon">
                
            </td>
            
            <td rowspan="4">
                <input type="button" value=" 查 询 " onclick="submit()"/>
                <input type="button" value=" 下载 " onclick="download()"/>
            </td>    
        </tr>
    </table>
    <table>

        <tr class="fields">
            <th width="8%">办公地址</th>
            <th width="8%">申请人</th>
            <th width="8%">采购人</th>
            <th width="8%">物品分类</th>
            <th width="10%">物品名称</th>
            <th width="6%">物品类型</th>
            <th width="8%">申请时间</th>
            <th width="8%">状态</th>
            <th width="8%">快递单号</th>
            <th width="8%">采购链接</th>
            <th width="10%">备注</th>
            <th width="8%">操作</th>
        </tr>
    <#if list??>
        <#list list as list>
            <tr class="even_row">
                <td align="center">${list.center_name}</td>
                <td align="center">${list.sq_user}</td>
                <td align="center">${list.purchaser}</td>
                <td align="center" title="${list.goods_childs}">${list.goods_name}</td>
                <td align="center">${list.item_name}</td>
                <td align="center">
                    <#if  list.type=="1">
                        固定资产
                    <#elseif  list.type=="2">
                        消耗品
                    </#if>

                </td>
                <td align="center">${list.create_time}</td>
                <td align="center">
                    <#if list.apply_status=="1">
                   			       未审核
                    <#elseif list.apply_status=="2">
                      		     审核通过
                    </#if>
                </td>
                <td align="center">${list.purchasing_num}</td>
                <td>
                    <a title="${list.purchasing_link}">
                        <em class="caption"></em>
                        <#if list.purchasing_link?length gt 9>${list.purchasing_link?substring(0,9)}...<#else>${list.purchasing_link}</#if>
                    </a>
                </td>
                <td>
                    <a title="${list.msg}">
                        <em class="caption"></em>
                        <#if list.msg?length gt 9>${list.msg?substring(0,9)}...<#else>${list.msg}</#if>
                    </a>
                </td>
                <td align="center">
                <#if webutil.getCookieUser().username=="liulan">
	                <#if list.apply_status=="1">
	                	<a href="${contextPath}/goods/xqGoods.htm?id=${list.id}">审核</a>
	                <#elseif list.apply_status=="2">
	                	<a href="${contextPath}/goods/xqGoods.htm?id=${list.id}&flag=see">查看</a>
	                </#if>
	                <#if list.purchasePerson??>
	                	--&nbsp; <a href="#" onclick="seeAppraisalGoods(${list.id})">查看评价</a>
	                </#if>
                <#elseif webutil.getCookieUser().departments=="行政教务部">
	                <a href="${contextPath}/goods/addGoods.htm?id=${list.id}">编辑</a>
	                <#if list.purchasePerson??>
	                	--&nbsp; <a href="#" onclick="seeAppraisalGoods(${list.id})">查看评价</a>
	                </#if>
	            <#else>
                	<a href="${contextPath}/goods/xqGoods.htm?id=${list.id}&flag=see">查看</a>
                </#if>
                </td>
            </tr>
        </#list>
    </#if>

    </table>
</div>
<div class="emptyline"></div>
<div class="theme-popover">
    <div class="theme-poptit">
        <a href="javascript:;" title="关闭" class="close">X</a>
        <h3>物品采购评价</h3>
    </div>
    <div class="theme-popbod dform">
        <form class="theme-signin" >
          <ol>
                <li><strong>采购效率评价：</strong>
                    <select id="purchasePerson1" disabled>
	            		<option value="">请选择评分:</option>
	            		<option value="1">1分</option>
	            		<option value="2">2分</option>
	            		<option value="3">3分</option>
	            		<option value="4">4分</option>
	            		<option value="5">5分</option>
	            	</select><br/><br/>

                <li><strong>采购物品评价 ：</strong>
                	<select id="purchaseGoods1" disabled>
					<option value="">请选择评分:</option>
	            		<option value="1">1分</option>
	            		<option value="2">2分</option>
	            		<option value="3">3分</option>
	            		<option value="4">4分</option>
	            		<option value="5">5分</option>
	            	<select id="center4"><br/><br/>
                <li>
                 <li><strong>&nbsp;发表评价：</strong>
                	<textarea  style="width:200px;height:100px;" type="text" id="purchaseMessage1" disabled/></textarea>
                <li>
            </ol>
        </form>
    </div>
</div>
<div class="theme-popover-mask"></div>
<div id="pager">
    <ul id="pagination" style="padding-left: 14px">
    <#if page??>
        <#if page.pagetotal?? && page.pagetotal!="0">
            <#assign pagetotal = page.pagetotal>
        <#else>
            <#assign pagetotal = 1>
        </#if>
        <#if page.currpage??>
            <#assign currpage = page.currpage>
        <#else>
            <#assign currpage = 1>
        </#if>
        <#if currpage==1 >
            <li class="previous-off">首页</li>
            <li class="previous-off">上一页</li>
        <#else>
            <li class="previous"><a href="${contextPath}/goods/myGoodsList.htm?&auditStatus=${auditStatus}&currPage=1&center=${center}&itemName=${itemName}&startTime=${startTime}&endTime=${endTime}">首页</a>
            </li>
            <li class="previous"><a
                    href="${contextPath}/goods/myGoodsList.htm?&auditStatus=${auditStatus}&currPage=${currpage-1}&center=${center}&itemName=${itemName}&startTime=${startTime}&endTime=${endTime}">上一页</a>
            </li>
        </#if>
        <input type="hidden" id="total" value="${page.pagetotal}"/>
        <#if pagetotal<=11>
            <#list 1..pagetotal as index_up>
                <#if currpage==index_up >
                    <li class="current">${index_up}</li>
                <#else>
                    <li>
                        <a href="${contextPath}/goods/myGoodsList.htm?&auditStatus=${auditStatus}&currPage=${index_up}&center=${center}&itemName=${itemName}&startTime=${startTime}&endTime=${endTime}">${index_up}</a>
                    </li>
                </#if>
            </#list>
        <#else>
            <#if currpage<=8 >
                <#list 1..9 as index_up>
                    <#if currpage==index_up >
                        <li class="current">${index_up}</li>
                    <#else>
                        <li>
                            <a href="${contextPath}/goods/myGoodsList.htm?&auditStatus=${auditStatus}&currPage=${index_up}&center=${center}&itemName=${itemName}&startTime=${startTime}&endTime=${endTime}">${index_up}</a>
                        </li>
                    </#if>
                </#list>
                <li>...</li>
                <li>
                    <a href="${contextPath}/goods/myGoodsList.htm?&auditStatus=${auditStatus}&currPage=${pagetotal}&center=${center}&itemName=${itemName}&startTime=${startTime}&endTime=${endTime}">${pagetotal}</a>
                </li>

            <#elseif (currpage>= 9 && currpage<pagetotal-7)  >
                <li><a href="${contextPath}/goods/myGoodsList.htm?&auditStatus=${auditStatus}&currPage=1&center=${center}&itemName=${itemName}&startTime=${startTime}&endTime=${endTime}">1</a></li>
                <li>...</li>
                <#list currpage-3..currpage+3 as index_up>
                    <#if currpage==index_up >
                        <li class="current">${index_up}</li>
                    <#else>
                        <li>
                            <a href="${contextPath}/goods/myGoodsList.htm?&auditStatus=${auditStatus}&currPage=${index_up}&center=${center}&itemName=${itemName}&startTime=${startTime}&endTime=${endTime}">${index_up}</a>
                        </li>
                    </#if>
                </#list>
                <li>...</li>
                <li>
                    <a href="${contextPath}/goods/myGoodsList.htm?&auditStatus=${auditStatus}&currPage=${pagetotal}&center=${center}&itemName=${itemName}&startTime=${startTime}&endTime=${endTime}">${pagetotal}</a>
                </li>
            <#else>
                <li><a href="${contextPath}/goods/myGoodsList.htm?currPage=1&auditStatus=${auditStatus}&center=${center}&itemName=${itemName}&startTime=${startTime}&endTime=${endTime}">1</a></li>
                <li>...</li>
                <#list pagetotal-8..pagetotal as index_up>
                    <#if currpage==index_up >
                        <li class="current">${index_up}</li>
                    <#else>
                        <li>
                            <a href="${contextPath}/goods/myGoodsList.htm?&auditStatus=${auditStatus}&currPage=${index_up}&center=${center}&itemName=${itemName}&startTime=${startTime}&endTime=${endTime}">${index_up}</a>
                        </li>
                    </#if>
                </#list>
            </#if>
        </#if>
        <#if currpage==pagetotal >
            <li class="previous-off">下一页</li>
            <li class="previous-off">尾页</li>
        <#else>
            <li class="previous"><a
                    href="${contextPath}/goods/myGoodsList.htm?&auditStatus=${auditStatus}&currPage=${currpage+1}&center=${center}&itemName=${itemName}&startTime=${startTime}&endTime=${endTime}">下一页</a>
            </li>
            <li class="previous"><a
                    href="${contextPath}/goods/myGoodsList.htm?&auditStatus=${auditStatus}&currPage=${page.pagetotal}&center=${center}&itemName=${itemName}&startTime=${startTime}&endTime=${endTime}">尾页</a>
            </li>
        </#if>
        <li class="previous"></li>
        <li class="pageinfo">共${page.total}条记录</li>
    </#if>
    </ul>
</div>

</body>
</html>